﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WeiboRegister1.aspx.cs" Inherits="validator_WeiboRegister1" %>

<%@ Register Assembly="zoyobar.shared.panzer.JQueryElement" Namespace="zoyobar.shared.panzer.ui.jqueryui"
	TagPrefix="je" %>
<%@ Register Assembly="zoyobar.shared.panzer.JQueryElement" Namespace="zoyobar.shared.panzer.ui.jqueryui.plusin"
	TagPrefix="je" %>
<%@ Register Assembly="zoyobar.shared.panzer.JQueryElement" Namespace="zoyobar.shared.panzer.web.jqueryui"
	TagPrefix="je" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title>微博注册</title>
	<link rel="stylesheet" type="text/css" href="../css/smoothness/jquery-ui-1.8.15.custom.css" />
	<script type="text/javascript" src="../js/jquery-1.6.2.min.js"></script>
	<script type="text/javascript" src="../js/jquery-ui-1.8.15.custom.min.js"></script>
	<link rel="stylesheet" type="text/css" href="../css/main.css" />
	<script type="text/javascript">
		function refresh(value, tip, valid) {

			if (vEmail.__validator('option', 'valid') && vPassword.__validator('option', 'valid') && vNickname.__validator('option', 'valid') && vAge.__validator('option', 'valid'))
				cmdRegister.button('enable');
			else
				cmdRegister.button('disable');

		}
	</script>
</head>
<body>
	<form id="formWeiboRegister1" runat="server">
	<div class="title darkred-title">
		微博注册
		<iframe src="../about.htm" frameborder="0" height="160" width="100%" allowtransparency="true" scrolling="no"></iframe>
	</div>
	<div class="content">
		<h2>
			说明
		</h2>
		<blockquote>
			请确保已经阅读 <a href="../returnjson/Default.aspx">在不同的 .NET 版本中返回 JSON</a>. 本页代码中注册按钮的 Success 事件符合 .NET 2.0 版本, 其它版本请另作调整.<br />
			<br />
			<strong>视频解说:</strong> <a href="http://www.tudou.com/programs/view/vz3kFojbU58/" target="_blank">
				www.tudou.com/programs/view/vz3kFojbU58/</a>
		</blockquote>
		<h2>
			示例
		</h2>
		<blockquote>
			<strong>邮箱:</strong>
			<input id="email" type="text" />
			<je:Validator ID="vEmail" runat="server" IsVariable="true" Target="#email" Need="true"
				NeedTip='<font color="red">请填写您的邮箱地址</font>' Reg="$.panzer.reg.email" RegTip='<font color="red">请填写一个正确的邮箱地址</font>'
				Checked="refresh">
			</je:Validator>
			<br />
			<br />
			<strong>密码:</strong>
			<input id="password" type="password" />
			<je:Validator ID="vPassword" runat="server" IsVariable="true" Target="#password"
				Equal="#password2" EqualTip='<font color="red">两次输入的密码需要一致</font>' Need="true"
				NeedTip='<font color="red">请填写您的密码</font>' Min="4" MinTip='<font color="red">密码长度至少 4 位</font>'
				Max="10" MaxTip='<font color="red">密码长度最多 10 位</font>' SuccessTip="Ok 了" Checked="refresh">
			</je:Validator>
			<br />
			<br />
			<strong>再次:</strong>
			<input id="password2" type="password" />
			<br />
			<br />
			<strong>昵称, 输入 abc 将提示已经注册:</strong>
			<input id="nickname" type="text" />
			<je:Validator ID="vNickname" runat="server" IsVariable="true" Target="#nickname"
				Need="true" NeedTip='<font color="red">请填写您的昵称</font>' SuccessTip="Ok 了" Checked="refresh">
				<CheckAsync Url="webservice.asmx" MethodName="CheckNickname" Success="
				function(pe, e){
					
					if(!e.valid && null != e.tip)
						pe.jquery.html(e.tip);

				}
				">
				</CheckAsync>
			</je:Validator>
			<br />
			<br />
			<strong>年龄:</strong>
			<input id="age" type="text" />
			<je:Validator ID="vAge" runat="server" IsVariable="true" Target="#age" Need="true"
				NeedTip='<font color="red">请填写您的年龄</font>' Type="number" TypeTip='<font color="red">请填写一个数字</font>'
				Min="10" MinTip="不能小于 10 岁" Max="200" MaxTip="您还活着吗?" SuccessTip='<font color="blue">Ok 了</font>' Checked="refresh">
			</je:Validator>
			<br />
			<br />
			<je:Button ID="cmdRegister" runat="server" IsVariable="true" Label="注册" Disabled="true">
				<ClickAsync Url="webservice.asmx" MethodName="RegisterWeibo" Success="
				function(data){
					alert(data);
				}
				">
					<ParameterList>
						<je:Parameter Name="email" Type="Expression" Value="vEmail.__validator('option', 'value')" />
						<je:Parameter Name="password" Type="Expression" Value="vPassword.__validator('option', 'value')" />
						<je:Parameter Name="nickname" Type="Expression" Value="vNickname.__validator('option', 'value')" />
						<je:Parameter Name="age" Type="Expression" Value="vAge.__validator('option', 'value')" />
					</ParameterList>
				</ClickAsync>
			</je:Button>
		</blockquote>
	</div>
	</form>
</body>
</html>
